package com.example.demo.study.exception;

import java.util.Scanner;

// exception 异常处理

public class Person {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个除数：");
        int numb = scanner.nextInt();
        try {
            System.out.print("请输入一个被除数：");
            int numb2= scanner.nextInt();
            System.out.print("结果是：" + numb / numb2);
        }catch (Exception e){
            System.out.println(e.fillInStackTrace());
            System.out.println(e.getMessage());
//            System.exit(1);
        }finally{
            System.out.println("程序结束！");
        }


    }
}
